package zuoye2;

public class Demo1 {
    public static void main(String[] args) {
        int sum1 = 0;//定义奇数和
        int sum2 = 0;//定义偶数和
        for (int i = 0; i < 100; i++) {//遍历0-100
            if (i%2!=0){//判断奇偶
                sum1+=i;
            }else{
                sum2+=i;
            }
        }
        System.out.println("奇数和：" + sum1);
        System.out.println("偶数和：" + sum2);
    }
}
